/*pmFWCFu5nhKkBzYmrkBakQXgiS7+qL9s6yMsMxr9MA4=*/
import { toast } from 'nc-lightapp-front';
import { modifierSearchMetas } from '../../../../public/components/pubUtils/arapListSearchRefFilter';
import { pagecode, appcode, searchId, billType } from '../constants';
import setDefOrgBilldateSrchArea from '../../../../public/components/defOrgBilldateSrchArea.js';

export default function (props) {
	let that = this
	if(!props.getUrlParam('src_appcode')){
		props.setUrlParam({ src_appcode: appcode});
		toast({ color: 'warning', content: this.state.json['public-000250'] });
	}
	props.createUIDom(
		{
			pagecode: pagecode,
			appcode: props.getUrlParam('src_appcode'),
			reqDataQueryappcontext:{
				rqUrl: '/platform/appregister/queryappcontext.do',
				rqJson: JSON.stringify({ pagecode: pagecode, appcode: appcode }),
				rqCode: 'context',
			}
		},
		
		function (data) {
			if (data) {
				if (data.template) {
					if (!data.template[searchId]) {
						return;
					}
					//高级查询设置财务组织默认值
					// data.context.paramMap.pk_transtype=null;
					// data.context.paramMap.transtype_name=null;

					setDefOrgBilldateSrchArea(props, searchId, data);
					let meta = data.template;
					modifierSearchMetas(searchId, props, meta, billType,null,that);
					// props.meta.setMeta(meta);
					props.meta.addMeta(meta);
				}
				if (data.button) {
					let button = data.button;
					props.button.setButtons(button);
				}

				let generType = that.props.search.getSearchValByField(searchId, 'generationType');
				if (generType && generType.value.firstvalue != that.generationType) {
					that.generationType = generType.value.firstvalue;
				}
		
			}
		}
	);
}
/*pmFWCFu5nhKkBzYmrkBakQXgiS7+qL9s6yMsMxr9MA4=*/